
function ajaxReqParm(method , url , reqStr , sync){
	var result = "";
	$.ajax({
	   type: method,
	   async: sync,
	   url: url,
	   data: "reqStr="+reqStr,
	   success: function(msg){
		   result =msg;
	   }
	});
	return result;
}



function ajaxReqDiyParm(method , url , reqStr , sync){
	var result = "";
	$.ajax({
	   type: method,
	   async: sync,
	   url: url,
	   data: reqStr,
	   success: function(msg){
		   result =msg;
	   }
	});
	return result;
}





function ajaxReq(method , url , sync){
	var result = "";
	$.ajax({
	   type: method,
	   async: sync,
	   url: url,
	   success: function(msg){
		   result =msg;
	   }
	});
	return result;
}

function doGet(url , reqStr){
	var result = "";
	if(reqStr==null || reqStr==""){
		result = ajaxReq("GET", url , false);
	}else{
		result = ajaxReqParm("GET", url, reqStr , false);
	}
	return result;
}
function doGetSync(url , reqStr , sync){
	var result = "";
	if(reqStr==null || reqStr==""){
		if(sync==null || sync==""){
			result = ajaxReq("GET", url , false);
		}else{
			result = ajaxReq("GET", url , true);
		}
	}else{
		if(sync==null || sync==""){
			result = ajaxReqParm("GET", url, reqStr , false);
		}else{
			result = ajaxReqParm("GET", url, reqStr , true);
		}
	}
	return result;
}

function doPostDiy(url , reqStr ){
	var result = "";
	if(reqStr==null || reqStr==""){
		result = ajaxReq("POST", url , false);
		
	}else{
		result = ajaxReqDiyParm("POST", url, reqStr , false);
	}
	return result;
}

function doPost(url , reqStr ){
	var result = "";
	if(reqStr==null || reqStr==""){
		result = ajaxReq("POST", url , false);
		
	}else{
		result = ajaxReqParm("POST", url, reqStr , false);
	}
	return result;
}
function doPostSync(url , reqStr , sync){
	var result = "";
	if(reqStr==null || reqStr==""){
		if(sync==null || sync==""){
			result = ajaxReq("POST", url , false);
		}else{
			result = ajaxReq("POST", url , true);
		}
		
	}else{
		if(sync==null || sync==""){
			result = ajaxReqParm("POST", url, reqStr , false);
		}else{
			result = ajaxReqParm("POST", url, reqStr , true);
		}
	}
	return result;
}




function doGetEn(url , reqStr){
	var result = "";
	result = ajaxReqParm("GET", url, reqStr);
	return result;
}

function doPostEN(url , reqStr){
	var result = "";
	result = ajaxReq("POST", url, reqStr);
	return result;
}





function getFormValueAll(formId , summernoteId) {  
	var map = {};
	var form = document.getElementById(formId);  
	var tagElements = form.getElementsByTagName('input');  
	for (var j = 0; j < tagElements.length; j++){ 
		var obj = tagElements[j];
		if("blogContent"==obj.name){
			if(summernoteId!=null && summernoteId!=""){
				map[obj.name]=$("#"+summernoteId).summernote('code').replace(/&nbsp;/g, "|RP|");
			}
		}else
		if(obj.name!=null && obj.name!="undefined" &&obj.name!=""){
			map[obj.name]=obj.value;
		}
	} 
	var tagElements_select = form.getElementsByTagName('select');
	for (var j = 0; j < tagElements_select.length; j++){ 
		var obj = tagElements_select[j];
		if(obj.name!=null && obj.name!="undefined" &&obj.name!=""){
			console.log(obj);
			map[obj.name]=obj.value;
			map[obj.name+'_cn']=$(obj).text();
		}
	} 
	return map;  
}  



function getFormValue(formId ) {  
	var map = {};
	var form = document.getElementById(formId);  
	var tagElements = form.getElementsByTagName('input');  
	for (var j = 0; j < tagElements.length; j++){ 
		var obj = tagElements[j];
		if(obj.name!=null && obj.name!="undefined" &&obj.name!=""){
			map[obj.name]=obj.value;
		}
	} 
	return map;  
}



/**
 * 获取返回数据
 * @param respone
 * @returns
 */
function getResponeData(respone){
	var reObj;
	if(respone!=null && respone !=""){
		var obj = respone.detail;
		if(obj!=null && obj !=""){
			reObj = obj;
		}else{
			alert("返回数据为空！");
		}
	}else{
		alert("返回数据为空！");
	}
	return reObj;
}